<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<title>佣金报表</title>
		<link rel="stylesheet" href="__OEM__/css/iconfont.css" />
		<link rel="stylesheet" href="__OEM__/css/css.css" />
	</head>

	<body>
		{include file="public/header" /}
		<div class="index_conbox">
			<div class="index_content clearfix">
				{include file="public/lefter" /}
				<div class="right">
					<div class="rigtop">
						<span class="title">佣金报表</span>
					</div>
					<div class="indrig_con">
						
						<form id="my_form" action="{:url('count/commission')}" method="post">
							<div class="shxx_row clearfix" style="margin-top: 10px;">
								<div class="left">日期：</div>
								<div class="right clearfix">
					                <div class="layui-inline">
								      <div class="layui-input-inline">
								        <input type="text" class="layui-input" name="begin_time" id="begin_time" placeholder="yyyy年MM月dd日">
								      </div>
								    </div>
					                <i class="chax_line"></i>
					                <div class="layui-inline">
								      <div class="layui-input-inline">
								        <input type="text" class="layui-input" name="end_time"  id="end_time" placeholder="yyyy年MM月dd日">
								      </div>
								    </div>
					            </div>
								<button type="submit" onclick="return check_time()" class="htcxbtn">查询</button>
							</div>
					    </form>
						<div class="chax_jiegbt clearfix">
							<div class="chax_jieg">总佣金：<?php echo $sumbalance ? $sumbalance:0.00 ?>元</div>
							<div class="chax_xzbtnbox">
								<a href="#" onclick="check()"><i class="iconfont icon-daochu"></i>导出</a>
							</div>
						</div>
						<div class="help_lisbox">
							<table class="zizh_table1">
								<thead>
									<tr>
										<th>类型</th>
										<th>详情</th>
										<th>变化金额</th>
										<th style="width: 200px;">时间</th>
									</tr>
								</thead>
								<tbody id="tbody">
									{volist name="list" id="vo" empty="$empty"}
									<tr>
										<td>
											{switch name="$vo.order_type" }
											    {case value="1"}订单佣金{/case}
											    {case value="2"}扫码佣金{/case}
											    {case value="3"}广告佣金{/case}
											    {case value="4"}退款佣金{/case}
											    {case value="5"}佣金转余额{/case}
											    {case value="6"}线下收银{/case}
											    {case value="7"}费率佣金{/case}
											   	{case value="8"}会员转账{/case}
											   	{case value="9"}会员购买鼓励金{/case}
											{/switch}
										</td>
										<td>{$vo.message}</td>
										<td>{$vo.balance}</td>
										<td>{$vo.add_time}</td>
									</tr>
									{/volist}
								</tbody>
							</table>
							<div class="fenye" style="display: block;">
								{$list->render()}
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		{include file="public/footer" /}
	</body>

</html>
<script>
	layui.use('laydate', function(){
		var laydate = layui.laydate;
		
		//日期控件
		laydate.render({
		    elem: '#begin_time'
		    ,type: 'datetime'
		    ,format: 'yyyy-MM-dd HH:mm:ss'
		});
		  
		laydate.render({
		    elem: '#end_time'
		    ,type: 'datetime'
		    ,format: 'yyyy-MM-dd HH:mm:ss'
		});
	})
	//时间区间
	function check_time(){
		var begin_time 	= $('#begin_time').val();
		var end_time 	= $('#end_time').val();	
		if(begin_time.length > 2 || end_time.length > 2){
			
			if(begin_time.length < 2 || end_time.length < 2){
				layer.msg("请输入查询时间区间");
				return false;
			}
			
		}
	}
	
	function check() {
		var begin_time = $('#begin_time').val();
		var end_time = $('#end_time').val();		

		window.location.href = "/oem/count/details_dc.html?begin_time=" + begin_time + "&end_time=" + end_time;
	}
	
</script>
